
from collections.abc import Iterable ,Iterator


def generate_numbers(n):
    print("----------------")

    for i in range(n):
        yield i
        print(i)


gen = generate_numbers(3)

# gen.__next__()
# gen.__next__()
# gen.__next__()
# gen.__next__()
try:
    next(gen)
    next(gen)
    next(gen)
    next(gen)

except StopIteration:
    pass
print("Boolean", isinstance(gen, Iterator))
print("Boolean", isinstance(gen, Iterable))
